package com.thirdgroup.dao.impl;

import com.thirdgroup.dao.NoticeDao;
import com.thirdgroup.dao.base.BaseDAO;
import com.thirdgroup.pojo.entity.SysNotice;

import java.util.List;

public class NoticeDaoImpl extends BaseDAO<SysNotice> implements NoticeDao {
    @Override
    public List<SysNotice> selectAll() {
        String sql="select * from sys_notice order by createTime desc;";
        return super.findAll(sql,null);
    }

    @Override
    public Integer create(String content,Integer type,String date) {
        String sql="insert into sys_notice values(null,?,?,?)";
        Object[] params={type,content,date};
        return super.executeSQL(sql,params);
    }
}
